package com.javaworld.hotels.model;

import java.util.ArrayList;
import java.util.List;

import com.javaworld.hotels.businessobjects.Hotel;

public class HotelModel {
	private static String[] cities =
	{
		"Paris",
		"London",
	};
	private static Hotel[] hotels = {
		new Hotel("Hotel Latin","Quartier latin","Paris",3),
		new Hotel("Hotel Etoile","Place de l'Etoile","Paris",4),
		new Hotel("Hotel Vendome","Place Vendome","Paris",5),
		new Hotel("Hotel Hilton","Trafalgar Square","London",4),
		new Hotel("Hotel Ibis","The City","London",3),
	};
	public List<Hotel> findHotelsByCity(String city){
		List<Hotel> hotelsFound = new ArrayList<Hotel>();
		
		for(Hotel hotel : hotels) {
			if (hotel.getCity().equalsIgnoreCase(city)) {
				hotelsFound.add(hotel);
			}
		}
		
		return hotelsFound;
	}	
	public String[] findAvailableCities() {
		return cities;
	}
}
